package oop.ex2.expression;

import oop.ex2.exceptions.EmptyExpression;
import oop.ex2.exceptions.ExpectedAtomicExpression;
import oop.ex2.exceptions.ExpectedBinaryOperation;
import oop.ex2.exceptions.TerminatingStringNotFound;
import oop.ex2.exceptions.TokenNotRecognized;
import oop.ex2.tokenizer.Tokenizer;

/**
 * This subclass is in charge of holding symbols which aren't supposed to be evaluated. 
 * For example ')' and '}'.
 * @author daniel_i_l
 *
 */
public class SymbolNode extends ExpressionNode {
	private final static NodeType NODE_TYPE = NodeType.SYMBOL;

	/**
	 * Construct a symbol node using the matched string.
	 * @param matchedString The string that was matched that caused this node to be generated.
	 */
	public SymbolNode(String matchedString) {
		super(matchedString);
		_nodeType = NODE_TYPE;
	}

	@Override
	public void generateChildren(Tokenizer tokenizer)
			throws TokenNotRecognized, EmptyExpression,
			ExpectedAtomicExpression, ExpectedBinaryOperation,
			TerminatingStringNotFound {
		
		//don't do anything. this should never be called anyway.
		return;

	}

	@Override
	public double calculateNode() {
		//this cannot be calculated anyway.
		return 0;
	}

}
